home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 001a / tlxjwpc5.zip / CAP.SLT next >
Text File  |  1990-09-21  |  5KB  |  109 lines

  1. //╔═════════════════════════════════════════════════════════════════════╗
  2. //║ RBBS 17.3A         JW-PC Consulting DataFlex.HST      (608)837-1923 ║
  3. //║ Dual Std HST/V.32/MNP5/V.42     RBBSnet 8:972/2     FIDOnet 1:121/8 ║
  4. //╚═════════════════════════════════════════════════════════════════════╝
  5. // Telix 3.XX script to either automatically open or to query the
  6. // user about opening a capture file.
  7. //
  8. // JW> This useful Telix script was captured from the Telix Echo
  9. // JW> and reformatted in order to compile by Jim Wargula of Sun Prairie, WI.
  10. // JW> (JW-PC Consulting - BBS (608)837-1923).
  11. //
  12. // The capture file name is first six valid DOS filename characters
  13. // from the _entry_name to which you are connected, followed by two
  14. // digit day-of-the-month.  This ensures that a uniquely named capture
  15. // file will be created, and enables the user to track the files.
  16. // Provisions are made to specify a full path for the capture file,
  17. // such as "c:\telix\cap\" or whatever.  Telix always puts the
  18. // capture file in the default directory, and this feature permits
  19. // the user to decide regarding the capture directory.  Be sure to
  20. // include the trailing back-slash when specifying the capture directory!
  21. // If you want to use default directory for your captures, set cap_dir
  22. // equal to "" (that's quote quote).
  23. //
  24. // JW> Script modification note was added to place full date stamp into
  25. // JW> Capture file name in lieu of Phone Directory characters plus day number.
  26. // JW> This is more useful in many cases.  JW-PC Consulting
  27. //
  28. // If you ALWAYS want a capture file opened, change auto_cap to "y"
  29. // instead of "n".  The script will develop the capture file name,
  30. // and open it for you.  If you leave it as "n", the script will ask
  31. // you if you want a capture opened, and will act accordingly.
  32. //
  33. // This script was designed to be called by a logon script, or to
  34. // have this script call a logon script.  Alternately, you can leave
  35. // auto_cap as "y" and run the script via function key whenever you
  36. // want a capture file created.
  37. //
  38. // Developed by Jim Hanoian on 06JUL89
  39. //              11502 Roslyn Road
  40. //              Fredericksburg, VA  22401
  41. //              703-786-9253
  42. //
  43. // If you like and use this script, it would sure make my day if you
  44. // mailed me a dollar bill.
  45. //
  46. // Telix Echo at Thunderbolt BBS (1:265/13) phone (703)-373-9289.
  47. //
  48. // I will not be held liable for anything that this code does.
  49. //
  50. main() { if (capture_stat() != 0)           //If we have a capture file
  51.      {                                      //already open or paused,
  52. capture("*CLOSE*");                         //close it.
  53.      }
  54. str cap_dir[64]="c:\com\tlx\";              //Put your capture path here
  55. str auto_cap[]="n";                         //Change to "Y" for no-ask...
  56. str message[80]; str s[1];
  57. str cap_name[12];
  58. str dat[8];
  59. str day[2];
  60. int save;
  61. int key;
  62. int i;
  63. if (auto_cap != "Y" && auto_cap != "y")     //If auto_cap is NOT yes, ask...
  64.    {
  65.    save=vsavearea(10,10,66,13);             //Save the screen...
  66.    box(10,10,66,13,2,0,31);                 //Draw box, ask the question...
  67.    pstraxy("If you want to create a capture file, enter 'Y'",15,11,30);
  68.    pstraxy("otherwise, press any key to continue... ",20,12,30);
  69.    key=inkeyw();                            //Process the response
  70.    vrstrarea(save);                         //Restore the screen...
  71.    }
  72. if (auto_cap == "Y" || auto_cap == "y" || key == 89 || key == 121)
  73.    {                                        //if we have auto-yes, or response-yes
  74.    while (((strlen(_entry_name) > i)!=0) and ((strlen(cap_name) < 6)!=0))
  75.         {                                   //Parse _entry_name until we hit max
  76.         if ((isalnum (subchr(_entry_name,i)) != 0))
  77.            {                                //Build cap_name with "valid"
  78.            substr(_entry_name,i,1,s);       //chars from _entry_name
  79.            strcat(cap_name,s);              //one char at a time
  80.            }
  81.         i=i+1;
  82.         }
  83.     date(curtime(),dat);                    //Get the string date
  84. //  JW>  Comment out the next two lines if full date stamp is desired
  85.     substr(dat,3,2,day);                    //Just want the day
  86.     strcat(cap_name,day);                   //Add day to cap_name
  87. //  JW>  Uncomment the following line if full date stamp is desired
  88. //  strcat(cap_name,dat);                   //Add date to cap_name
  89.     strcat(cap_name,".CAP");                //Add ext to cap_name
  90.     strcat(cap_dir,cap_name);               //Put path in front of cap_name
  91.     strupper(cap_dir);                      //Make it all caps
  92.     if (capture(cap_dir) == -1)             //Try to open capture file,
  93.        {                                    //if error, construct message...
  94.        strcat(message,"ERROR in opening ");
  95.        strcat(message,cap_dir);
  96.        strcat(message," capture file.");
  97.        }
  98.        else
  99.           {                                 //if OK, construct message...
  100.           strcat(message,"Capture file ");
  101.           strcat(message,cap_dir);
  102.           strcat(message," successfully opened.");
  103.           }
  104.     }
  105. else
  106.     {                                       //If not wanted, construct message
  107.     strcat(message,"At your request, capture file was not opened.");
  108. }}
  109.